<template>
  <div>
    <el-form :model="form" size="small" inline>
      <el-form-item label="代码">
        <el-input v-model="form.code" />
      </el-form-item>
      <el-form-item label="时间">
        <el-date-picker v-model="form.startDate" value-format="yyyy-MM-dd" placeholder="" />
        <el-date-picker v-model="form.endDate" value-format="yyyy-MM-dd" placeholder="" />
      </el-form-item>
      <el-form-item label="">
        <el-button type="primary" size="small" @click="everyData">查询</el-button>
      </el-form-item>
    </el-form>
    <el-tabs>
      <el-tab-pane label="表格">
        <TableShow v-load="loading" :list="list" />
      </el-tab-pane>
      <el-tab-pane label="图表">
        <TableShow v-load="loading" :list="list" />
      </el-tab-pane>
    </el-tabs>
    <!-- <el-dialog title="详情" :visible.sync="showDeatilVisible" width="90%">
      <EveryPrice v-if="showDeatilVisible" :row="activeRow" />
    </el-dialog> -->
  </div>
</template>

<script>
import { everyData } from '@/api/stasitic'
import TableShow from './table'
// import EveryPrice from './everyPrice.vue'
export default {
  components: { TableShow },
  data() {
    return {
      loading: false,
      form: {},
      list: [],
      activeRow: {},
      showDeatilVisible: false
    }
  },
  mounted() {
    this.everyData()
  },
  methods: {
    async everyData() {
      this.loading = true
      const { list } = await everyData(this.form)
      console.log(list)
      this.list = list
      this.loading = false
    },
    showDeatil(row) {
      this.activeRow = { ...row }
      this.showDeatilVisible = true
    }
  }
}
</script>

<style>

</style>
